1. Field of the Invention
The invention relates in general to an image motion detection method and an image processing method, and an apparatus using the methods, and more particularly to an image motion detection method and an image processing method that determine an image motion by comparing pixel information at a same position in different blocks, and an apparatus using the methods.
2. Description of the Related Art
In an image processing apparatus, scaling is usually performed to reduce a transmission bandwidth and a storage space of image data. FIG. 1 shows a schematic diagram of a conventional image scaling operation. In FIG. 1, a second image Img2 is a next image of a first image Img1, and a third image Img3 is a next image of the second image Img2. Alphabetical denotations A, B, . . . and H represent positions in the first image Img1, the second image Img2 and the third image Img3, and pixels P1, . . . and P10 are corresponding pixels at the positions A, B, . . . and H. For example, in the first image Img1, the pixel at the position A is P1, and the pixel at the position B is P2; in the second image Img2, the pixel at the position A is P2, and the pixel at the position B is P3. Again referring to the first image Img1, in the first image Img1, the pixels at the positions A to H are respectively P1 to P8. When a scaling down operation is performed, the first image Img1 is processed by a scaling filter SF, which filters out the pixels at the positions B, D, F and H and leaves only the pixels P1, P3, P5 and P7 for further processing to generate pixels P1′, P3′, P5′ and P7′. It should be noted that the unfiltered pixels cannot be modified. That is, in the current situation, rather than the pixels P1′, P3′, P5′ and P7′, the pixels P1, P3, P5 and P7 are kept. In the following embodiments, descriptions are given based on processing the unfiltered pixels.
When a scaling up operation is performed on the down-scaled first image Img1, pixels (to be referred to as P2l, P4l, P6l and P8l) are interpolated for pixels originally at the positions B, D, F and H according to the pixels P1′, P3′, P5′ and P7′. One method for generating the pixels P2l, P4l, P6l and P8l is to interpolate the pixel P2l using the pixels P1′ and P3′, the pixel P4l using the pixels P3′ and P5′, the pixel P6l using the pixels P5′ and P7′, and P8l using the pixels P7′ and P9′ (located at the right of the pixel P8′). The pixels P1′, P3′, P5′ and P7′ become pixels P1″, P3″, P5″ and P7″ after the scaling up operation. Similarly, the pixels P1′, P3′, P5′ and P7′ are kept as the pixels P1′, P3′, P5′ and P7′ after the scaling up operation. In the following embodiments, examples of brightness of the unfiltered pixels being changed by the scaling up operation are illustrated in the descriptions.
In the second image Img2, the pixels at the positions A to H are respectively P2 to P9. That is, compared to the first image Img1, the image at the positions A to H in the second image Img2 is shifted to the left. Therefore, when a scaling down operation is performed on the second image Img2, the pixels at the positions B, D, F and H are similarly filtered out by the scaling filter SF to leave only the pixels P2′, P4′, P6′ and P8′. After scaling up the second image Img2, pixels P3l, P5l, P7l and P9l are interpolated.
In the third image Img3, the pixels at the positions A to H are respectively P3 to P10. That is, compared to the second image Img2, an image at the positions A to H in the third image Img3 is shifted to the left. Therefore, when a scaling down operation is performed on the third image Img3, the pixels at the positions B, D, F and H are similarly filtered out by the scaling filter SF to leave only the pixels P3′, P5′, P7′ and P8′. After scaling up the third image Img3, pixels F4l, P6l, P8l and P10l are interpolated.
It is seen from the foregoing descriptions that, in a situation of a moving image, the brightness of pixels that are scaled down and then scaled up constantly changes. For example, the brightness of the pixel P3 is the brightness of the pixel P3″ in the first image Img1, becomes the brightness of the pixel P3l interpolated according to the pixels P2 and P4 in the second image Img2, and restores to the brightness of the pixel P3″ in the third image Img3. As such, the brightness of the pixel P3 constantly changes while other pixels also encounter the same problem, leading to a flickering issue in the image.
Similarly, in an image processing apparatus, to reduce the transmission bandwidth and storage space of image data, a compression operation may be performed on the image data. FIGS. 2A, 2B, 2C, 3A and 3B show schematic diagrams of an image compression/decompression operation in the prior art. As shown in FIG. 2B, the first image Img1 includes pixels P11 to P56. During compression, the pixels P22 to P25 and P32 to P35 (represented by a non-compression band NCB in FIG. 2A) are compressed according to a compression band CB to form the compression band CB in FIG. 2A. The compression band CB is a half (only 4 pixels) of the size of the non-compression band NCB, and a value of a pixel in the compression band CB is an average of the corresponding pixels in the non-compression band NCB. For example, the brightness of the pixel in the compression band CB compressed based on the pixels P22 and P32 is the average of the pixels P22 and P32 (i.e., (P22+P32)/2), the brightness of the pixel in the compression band CB compressed based on the pixels P23 and P33 is the average of the pixels P23 and P33 (i.e., (P23+P33)/2), and so forth. After decompressing the compression band CB, the original brightness of the pixels is replaced by the brightness in the compression band CB to generate the decompression band DCB in FIG. 2A. For example, the brightness of the pixels P22 and P32 is replaced by (P22+P32)/2, and the brightness of the pixels P23 and P33 is replaced by (P23+P33)/2.
The second image Img2 in FIGS. 3A and 3B is a next image of the first image Img1 in FIGS. 2B and 2C. Compared to the first image Img1, the image comprising the pixels P11 to P56 in the second image Img2 is shifted upwards (a part indicated as OP in FIG. 3A). However, the position of the compression band CB remains the same as in FIGS. 2B and 2C, and so, instead of the pixels P22 to P25 and P32 to P35, the pixels P32 to P35 and P42 to P45 are compressed. After performing the compression and decompression procedure in FIG. 2A, the brightness of the pixels P32 to P35 and P42 to P45 in the second image Img2 is replaced by (P32+P42)/2, (P33+P43)/2, (P34+P44)/2 and (P35+P45)/2. Thus, the brightness of the pixels P22 to P25, P32 to P35 and P42 to P45 is the original brightness of the pixels P22 to P25, P32 to P35 and P42 to P45 in the first image Img1 and second image Img2 before compression, and however becomes different after the decompression. More specifically, the original brightness of the pixels P22 to P25, P32 to P35 and P42 to P45 after compressing/decompressing the first image Img1 and the second image Img2 is replaced by different brightness, leading to differences between the first image Img1 and the second image img2. As such, image flickering is likely resulted.
Therefore, the motion in the image needs to be detected in order to implement image processing steps such as scaling up/down and decompression. In a conventional motion detection method, the image motion is usually detected through sum of absolute differences (SAD). However, in such method, as differences between all pixels within a range of an image and all pixels within another range of another image need to be calculated, a tremendous amount of computation is involved.